<template>
    <div id="app">
        <AppHeader :poiInfo="poiInfo"/>
        <AppNav :commentNum="commentNum"/>
        <div class="content">
            <router-view/>
        </div>
    </div>
</template>

<script>
    import AppHeader from './components/public/Header'
    import AppNav from './components/nav/Nav'
    export default {
        name: 'App',
        components: {
            AppHeader,
            AppNav
        },
        data() {
            return {
                poiInfo: {},
                commentNum: 0
            }
        },
        methods: {
            // 
        },
        created() {
            fetch('/api/goods').then(response => response.json()).then(response => this.poiInfo = response.data.poi_info);
            fetch('/api/ratings').then(response => response.json()).then(response => this.commentNum = response.data.comment_num);
        }
    }
</script>

<style>
    @import url(common/css/icon.css);
</style>